package com.lianboke.link.ad.utils;

import android.text.TextUtils;

/**
 * 任务状态
 * Created by admin on 2018/1/29.
 */

public class OrderStatusUtils {

    /**
     * 获取任务状态()
     * @param status
     * @return
     */
    public static String getOrderStatusByZhuangJi(int status) {
        String strReuslt = "";
        switch (status) {
            case 1:
                strReuslt = "新任务";
                break;
            case 2:
                strReuslt = "进行中";
                break;
            case 3:
                strReuslt = "已完成";
                break;
            case 4:
                strReuslt = "已结算";
                break;
        }
        return strReuslt;
    }

    /**
     * 注册任务状态
     * @param status
     * @return
     */
    public static String getOrderStatusByZuCe(int status){
        String strReuslt ="";
        switch (status) {
            case 1:
                strReuslt = "新任务";
                break;
            case 2:
                strReuslt = "进行中";
                break;
            case 3:
                strReuslt = "审核中";
                break;
            case 4:
                strReuslt = "已结算";
                break;
        }
        return strReuslt;
    }

    /**
     * 根据任务的启动时间获取启动天数
     * @return
     */
    public static int getOrdersTimeSize(String strDurTime){
        int iOrderTimeSize = 0;
        if(TextUtils.isEmpty(strDurTime)){
            return 0;
        }
        try {
            String[] strTimesDatas = strDurTime.split("\\,");
            if(strTimesDatas==null){
                return 0;
            }
            iOrderTimeSize =  strTimesDatas.length;
        }catch (Exception e){

        }
        return iOrderTimeSize;
    }

}
